package com.dx.wx.service.impl;

import com.dx.wx.service.DxProductService;
import com.dx.wx.util.DxUtil;
import com.ejlchina.data.Array;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

@Service
public class DxProductServiceImpl implements DxProductService {

    @Override
    public Array findProduct(String appId) {
        Map filter = new HashMap();
        filter.put("field_name","product_status");
        filter.put("field_values", 1);
        filter.put("operator","EQ");
        Map appIdFilter = DxUtil.addAppIdFilter(appId);
        Map data = DxUtil.createSearchData(filter,appIdFilter);
        data.put("dataObjectApiName","ProductObj");
        return DxUtil.findSimple(data);
    }
}
